package com.hillerscopy.service;

import com.hillerscopy.model.Coupon;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Igor.Leonov
 * Date: 4/12/12
 * Time: 4:33 AM
 */
@Service
public class CouponServiceImpl implements CouponService {

    private List couponList;

    public CouponServiceImpl() {
        couponList = new ArrayList<Coupon>();
        couponList.add(new Coupon(1L, "FirstCoupon", 100, 50));
        couponList.add(new Coupon(2L, "SecondCoupon", 120, 80));
    }

    @Override
    public List<Coupon> loadCoupons() {
        return couponList;
    }

    @Override
    public void saveCoupon(Coupon coupon) {
        couponList.add(coupon);
    }
}
